Reliably transferring queued application messages

ABSTRACT

The present invention extends to methods, systems, and computer program products for reliably and securely transferring queued application messages. Application messages are (e.g.,. binary or text) encoded and then encapsulated in transfer messages, enqueue messages, and dequeue responses such that composable protocol elements used in application messages can be reused in the transfer messages, enqueue messages, and dequeue responses. Transfer message headers are encoded and then encapsulated along with encoded application messages such that composable protocol elements used in transfer headers and application messages can be reused in the store and forward messages. Application messages, transfer messages, enqueue messages, dequeue responses, and store and forward messages can all be configured in accordance with the same messaging protocol, such as, for example, Simple Object Access Protocol. Since encapsulated elements are encoded, the encapsulated elements do not interfere with configuration of wrapping messages.

CROSS-REFERENCE TO RELATED APPLICATIONS

Not applicable.

BACKGROUND OF THE INVENTION

1. The Field of the Invention

The present invention relates to electronic messaging and, moreparticularly, to reliably transferring queued application messages.

2. Background and Relevant Art

Computer systems and related technology affect many aspects of society.Indeed, the computer system's ability to process information hastransformed the way we live and work. Computer systems now commonlyperform a host of tasks (e.g., word processing, scheduling, and databasemanagement) that prior to the advent of the computer system wereperformed manually. More recently, computer systems have been coupled toone another and to other electronic devices to form both wired andwireless computer networks over which the computer systems and otherelectronic devices can transfer electronic data. As a result, many tasksperformed at a computer system (e.g., voice communication, accessingelectronic mail, controlling home electronics, Web browsing, andprinting documents) include the exchange of electronic messages betweena number of computer systems and/or other electronic devices via wiredand/or wireless computer networks.

Networks have in fact become so prolific that a simple network-enabledcomputing system may communicate with any one of millions of othercomputing systems spread throughout the globe over a conglomeration ofnetworks often referred to as the “Internet”. Such computing systems mayinclude desktop, laptop, or tablet personal computers; Personal DigitalAssistants (PDAs); telephones; or any other computer or device capableof communicating over a digital network.

In order to communicate over a network, one computing system (referredto herein as a “sending computing system”) constructs or otherwiseaccesses an electronic message and transmits the electronic message overa network to another computing system (referred to herein as a“receiving computing system”). The electronic message may be read by ahuman user as when the electronic message is an e-mail or instantmessage, or may be read, instead, by an application running on thereceiving computing system. The electronic message may be constructed byan application running on the sending computing system with the possibleassistance of a human user.

In some environments, applications communicate with one another usingqueued communication. Queued communication includes mechanisms for asending application to write a message into a queue and for a receivingapplication to read the message from the queue. The queue maintainscommunication state outside of the communicating parties, and provides alevel of indirection between them. Queued communication is beneficialsince it can increase fault tolerance.

For example, queued communication mechanisms can provide failureisolation allowing communicating applications to fail and restartindependently, without losing communication state. That is, a sendingapplication or receiving application can fail and a restart withoutlosing communication state related to communication between the sendingapplication and the receiving application. Further, queued communicationmechanisms can provide connectivity isolation allowing communicatingapplications to come and go as needed. Thus, after writing a message toa queue, a sending application can go down without affecting thereceiving applications ability to read the queued message.

To increase availability, some queue mechanisms implement a distributedqueue model. For example, a sending application writes to a queue nearthe sending application and a receiving application reads from a(potentially different) queue near the receiving application. Indistributed queue environments, the queues can transfer messages to andfrom other queues such that, for example, a message written to a sendingqueue (corresponding top a sending application) is delivered to areceiving queue (corresponding to a receiving application).

Unfortunately, most message queuing systems use proprietary protocolsthat limit interoperability. In some environments, such as, for example,relatively larger distributed networks, various queuing systems may beowned by different entities. Thus, in these environments there may be noway to ensure that all queuing systems implement a protocol that iscompatible with other queuing systems. Accordingly, queuing systems canbe limited to communicating only with other queuing systems thatimplement the same proprietary protocol.

Additionally, queuing environments (both single queue and distributedqueue) have limited, if any, mechanisms for ensuring secured, reliabletransfer of application messages from a sending application to areceiving application. For example, an application or queue failure cancause a message to be lost. Further, there is typically limited, if any,mechanism to store and forward messages at intermediaries and to recoverfrom a failure at a store and forward intermediary. Additionally, it isdifficult to guarantee that intermediaries ensure security constraintson messages and meet the reliable assurances specified for messages.Therefore systems, methods, and computer program products for reliablytransferring queued application messages would be advantageous.

BRIEF SUMMARY OF THE INVENTION

The foregoing problems with the prior state of the art are overcome bythe principles of the present invention, which are directed towardsmethods, systems, and computer program products for reliablytransferring queued application messages. A queue channel receives anapplication message configured in accordance with a messaging protocol,such as, for example, Simple Object Access Protocol (“SOAP”). The queuechannel configures an enqueue message in accordance with the messagingprotocol (e.g., SOAP). The enqueue message identifies a message queuethat is to queue the application message and possibly a message sessioncorresponding to the application message. The queue channel encodes theapplication message into a corresponding encoded application message.The queue channel encapsulates the encoded application message in theenqueue message. The queue channel sends the enqueue message to a queuemanager that controls the identified queue such that the applicationmessage can be queued for delivery to a receiving computer system.

A sending transfer layer dequeues the encoded application message. Thesending transfer layer configures a transfer message in accordance withthe messaging protocol (e.g., SOAP). The sending transfer messageidentifies the receiving computer system and, when appropriate, acorresponding message session. The sending transfer layer encapsulatesthe encoded application message in the transfer message. The sendingtransfer layer sends the transfer message for delivery to the receivingcomputer system.

A sending store and forward layer accesses the transfer message. Thesending store and forward layer encodes a transfer header from thetransfer message into a corresponding encoded transfer header. Thesending store and forward layer configures a store and forward messagein accordance with the messaging protocol (e.g., SOAP). The sendingstore and forward message is for delivery to a next store and forwardservice (an intermediary or a receiving computer system), based on theposition of the sending store and forward layer system relative to areceiving computer system that is to receive the application message.The sending store and forward layer encapsulates the encoded transferheader and the encoded application message into the store and forwardmessage. The sending store and forward service forwards the store andforward message to the next store and forward service.

In some embodiments, one or more intermediary store and forward servicesprocess store and forward messages that encapsulate an encoded transferheader and an encoded application message. An intermediate store andforward service accesses a store and forward message configured inaccordance with a messaging protocol (e.g., SOAP). The intermediatestore and forward service identifies a next store and forward service(another intermediate store and forward service or a receiving computersystem) that is to receive the encapsulated encoded transfer header andencapsulated encoded application message, based on the location of thestore and forward service relative to the receiving computer system. Theintermediate store and forward service configures a new store andforward message in accordance with the messaging protocol. Theintermediate store and forward service copies the body of the store andforward message into the body of the new store and forward message. Thestore and forward service forwards the new store and forward message tothe next store and forward service.

A receiving store and forward layer receives a store and forward messageconfigured in accordance with a messaging protocol (e.g., SOAP). Thereceiving store and forward layer decodes the encoded transfer headerinto a corresponding transfer header. The receiving store and forwardlayer configures a transfer message in accordance with the messagingprotocol (e.g., SOAP). The receiving store and forward layer includesthe transfer header in the transfer message to indicate how the transfermessage is to be transferred to an application. The store and forwardlayer encapsulates the encoded application message in the transfermessage and sends the transfer message to a receiving transfer layer.

The receiving transfer layer processes the transfer message. Thetransfer layer enqueues the encoded application message for delivery toan application. The transfer layer sends a message available message toindicate that the application message has been queued. A queue listenerreceives the message available message and sends a dequeue message tothe receiving transfer layer. The receiving transfer: layer receives thedequeued message and configures a dequeue response in accordance with:the message protocol (e.g., SOAP). The receiving transfer layerencapsulates the encoded application message in the dequeued response.

The receiving transfer layer sends the dequeue response to theapplication. The queue listener receives the dequeue response. The queuelistener decodes the encoded application message into the applicationmessage and sends the application message to the application. These andother objects and features of the present invention will become morefully apparent from the following description and appended claims, ormay be learned by the practice of the invention as set forthhereinafter.

BRIEF DESCRIPTION OF THE DRAWINGS

To further clarify the above and other advantages and features of thepresent invention, a more particular description of the invention willbe rendered by reference to specific embodiments thereof which areillustrated in the appended drawings. It is appreciated that thesedrawings depict only typical embodiments of the invention and aretherefore not to be considered limiting of its scope. The invention willbe described and explained with additional specificity and detailthrough the use of the accompanying drawings in which:

FIGS. 1A and 1B illustrate an example of a computer architecture thatfacilitates reliable transfer of queued application messages.

FIG. 2 illustrates an example flow chart of a method of reliably sendinga queued application message.

FIG. 3 illustrates an example flow chart of a method of reliablyforwarding a queued application message.

FIG. 4 illustrates an example flow chart of a method of reliablyreceiving a queued application message.

FIG. 5 illustrates an example state diagram of different reliablemessaging states at a sending computer system.

FIG. 6 illustrates an example state diagram of different reliablemessaging states at a receiving computer system

FIG. 7 illustrates a suitable operating environment for the principlesof the present invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

The principles of the present invention provide for reliablytransferring queued application messages. A queue channel receives anapplication message configured in accordance with a messaging protocol,such as, for example, Simple Object Access Protocol (“SOAP”). The queuechannel configures an enqueue message in accordance with the messagingprotocol (e.g., SOAP). The enqueue message identifies a message queuethat is to queue the application message and possibly a message sessioncorresponding to the application message. The queue channel encodes theapplication message into a corresponding encoded application message.The queue channel encapsulates the encoded application message in theenqueue message. The queue channel sends the enqueue message to a queuemanager that controls the identified queue such that the applicationmessage can be queued for delivery to a receiving computer system.

A sending transfer layer dequeues the encoded application message. Thesending transfer layer configures a transfer message in accordance withthe messaging protocol (e.g., SOAP). The sending transfer messageidentifies the receiving computer system and, wen appropriate, acorresponding the message session. The sending transfer layerencapsulates the encoded application message in the transfer message.The sending transfer layer sends the transfer message for delivery tothe receiving computer system.

A sending store and forward layer accesses the transfer message. Thesending store and forward layer encodes a transfer header from thetransfer message into a corresponding encoded transfer header. Thesending store and forward layer configures a store and forward messagein accordance with the messaging protocol (e.g., SOAP). The sendingstore and forward message is for delivery to a next store and forwardservice (an intermediary or a receiving computer system), based on theposition of the sending store and forward layer system relative to areceiving computer system that is to receive the application message.The sending store and forward layer encapsulates the encoded transferheader and the encoded application message into the store and forwardmessage. The sending store and forward service forwards the store andforward message to the next store and forward service.

In some embodiments, one or more intermediary store and forward servicesprocess store and forward messages that encapsulate an encoded transferheader and encoded application message. An intermediate store andforward service accessing a store and forward message configured inaccordance with a messaging protocol (e.g., SOAP). The intermediatestore and forward service identifies a next store and forward service(another intermediate store and forward service or a receiving computersystem) that is to receive the encapsulated encoded transfer header andan encapsulated encoded application message, based on the location ofthe store and forward service relative to the receiving computer system.The intermediate store and forward service configures a new store andforward message in accordance with the messaging protocol. Theintermediate store and forward service copies the body of the store andforward message into the body of the new store and forward message. Thestore and forward service forwards the new store and forward message tothe next store and forward service.

A receiving store and forward layer receives a store and forward messageconfigured in accordance with a messaging protocol (e.g., SOAP). Thereceiving store and forward layer decodes the encoded transfer headerinto a corresponding transfer header. The receiving store and forwardlayer configures a transfer message in accordance with the messagingprotocol (e.g., SOAP). The receiving store and forward layer includesthe transfer header in the transfer message to indicate how the transfermessage is to be transferred to an application. The store and forwardlayer encapsulates the encoded application message in the transfermessage and sends the transfer message to a receiving transfer layer.

The receiving transfer layer processes the transfer message. Thetransfer layer enqueues the encoded application message for delivery toan application. The transfer layer sends a message available message toindicate that the application message has been queued. A queue listenerreceives the message available message and sends a dequeue message tothe receiving transfer layer. The receiving transfer layer receives thedequeued message and configures a dequeue response in accordance withthe message protocol (e.g., SOAP). The receiving transfer layerencapsulates the encoded application message in the dequeued response.

The receiving transfer layer sends the dequeue response to theapplication. The queue listener receives the dequeue response. The queuelistener decodes the encoded application message into the applicationmessage and sends the application message to the application.

Embodiments within the scope of the present invention includecomputer-readable media for carrying or having computer-executableinstructions or data structures stored thereon. Such computer-readablemedia may be any available media, which is accessible by ageneral-purpose or special-purpose computer system. By way of example,and not limitation, such computer-readable media can comprise physicalstorage media such as RAM, ROM, EPROM, CD-ROM or other optical diskstorage, magnetic disk storage or other magnetic storage devices, or anyother media which can be used to carry or store desired program codemeans in the form of computer-executable instructions, computer-readableinstructions, or data structures and which may be accessed by ageneral-purpose or special-purpose computer system.

In this description and in the following claims, a “network” is definedas one or more data links that enable the transport of electronic databetween computer systems and/or modules. When information is transferredor provided over a network or another communications connection (eitherhardwired, wireless, or a combination of hardwired or wireless) to acomputer system, the connection is properly viewed as acomputer-readable medium. Thus, any such connection is properly termed acomputer-readable medium. Combinations of the above should also beincluded within the scope of computer-readable media.Computer-executable instructions comprise, for example, instructions anddata which cause a general-purpose computer system or special-purposecomputer system to perform a certain function or group of functions. Thecomputer executable instructions may be, for example, binaries,intermediate format instructions such as assembly language, or evensource code.

In this description and in the following claims, a “computer system” isdefined as one or more software modules, one or more hardware modules,or combinations thereof, that work together to perform operations onelectronic data. For example, the definition of aim a computer systemincludes the hardware components of a personal computer, as well assoftware modules, such as the operating system of the personal computer.The physical layout of the modules is not important. A computer systemmay include one or more computers coupled via a network. Likewise, acomputer system may include a single physical device (such as a mobilephone or Personal Digital Assistant “PDA”) where internal modules (suchas a memory and processor) work together to perform operations onelectronic data.

Those skilled in the art will appreciate that the invention may bepracticed in network computing environments with many types of computersystem configurations, including, personal computers, laptop computers,hand-held devices, multi-processor systems, microprocessor-based orprogrammable consumer electronics, network PCs, minicomputers, mainframecomputers, mobile telephones, PDAs, pagers, and the like. The inventionmay also be practiced in distributed system environments where local andremote computer systems, which are linked (either by hardwired datalinks, wireless data links, or by a combination of hardwired andwireless data links) through a network, both perform tasks. In-adistributed system environment, program modules may be located in bothlocal and remote memory storage devices.

FIGS. 1A and 1B illustrate an example of a computer architecture 100that facilitates reliable transfer of queued application messages.Depicted in computer architecture 100 are computer system 101, store andforward services 121 and 122, and computer system 111. Each of thecomputer systems and store and forward services can be connected to anetwork, such as, for example, a Local Area Network (“LAN”), Wide AreaNetwork (“WAN”), or even the Internet. Computer systems and store andforwards services connected to the network and can receive data from andsend data to other computer systems and store and forward servicesconnected to the network. Accordingly, computer systems and store andforward services 121 and 122, as well as other connected computersystems and store and forward services (not shown), can create messagerelated data and exchange message related data (e.g., Internet Protocol(“IP”) datagrams and other higher layer protocols that utilize IPdatagrams, such as, Transmission Control Protocol (“TCP”), HypertextTransfer Protocol (“HTTP”), Simple Mail Transfer Protocol (“SMTP”),etc.) over the network. For example, computer systems 101 and 111 andstore and forward services 121 and 122 can create SOAP envelopes,exchange SOAP envelopes over the network, and receive SOAP envelopes.

In FIG. 1A, Computer system 101 includes application 102, queue channel103, and queue manager 108. Application 102 can be a portion of adistributed application, such as, for example, a client proxycorresponding to application 112. Thus, from time to time, application102 can have application messages to deliver to application 112. Queuechannel 103 enqueues application messages for storage in queuescontrolled by queue manager 108. Queue channel 103 can includeApplication Program Interfaces (“APIs”) that are called to enqueue amessage. Accordingly, application 102 can call an API subroutine toenqueue an application message in message queue 107.

Queue manager 108 includes messages queue 107, transfer layer 104, andstore and forward layer 106. Message queue 107 is configured to queueapplication messages sent from applications at computer system 101(e.g., application 102) to other computer systems and to queueapplication messages from other computer systems that are sent to;applications at computer system 101. Transfer layer 104 is configured tosend transfer messages to and receive transfer messages from other queuemanagers (e.g., queue manager 118). Store and forward layer 106 isconfigured to send store and forward messages to and receive store andforward messages from other store and forward layers (e.g., store andforward layer 116) and store and forward services (e.g., store andforward services 121 and 122).

Within computer architecture 100, queue manager 108 and application 102are both depicted as residing at computer system 101. However, it wouldbe apparent to one skilled in the art, after having reviewed thisdescription, that a queue manager and application that utilizes thequeue manager can reside at different computer systems. For example,queue manager 108 can reside at some other computer system that isnetwork connectable to computer system 101. In some embodiments,applications at a plurality of different computer systems read messagesfrom a single queue to provide load-balancing.

Store and forward services 121 and 122 are intermediate store andforward services that send store and forward messages to other store andforward services and store and forward layers and receive store andforward messages from other store and forward services and store andforward layers.

FIG. 1B, computer system 111 includes application 112, queue listener113, and queue manager 118. Application 112 can be a portion of adistributed application, such as, for example, a service correspondingto application 112. Thus, from time to time, application 112 can haveapplication messages that are received from application 102. Queuelistener 113 dequeues application messages from queues controlled byqueue manager 118. Accordingly, queue listener 133 can dequeueapplication messages from message queue 117. Queue listener 113 can alsoaccept sessions from other queue managers, register interest inapplication messages corresponding to a specified session, and send wakeup notifications to interested applications.

Queue manage 118 includes messages queue 117, transfer layer 114, andstore and forward layer 116. Message queue 117 is configured to queueapplication messages sent from applications at computer system 111(e.g., application 112) to other computer systems and to queueapplication messages from other computer systems that are sent toapplications at computer system 101. Transfer layer 114 is configured tosend transfer messages to and receive transfer messages from other queuemanagers (e.g., queue manager 108). Store and forward layer 116 isconfigured to send store and forward messages to and receive store andforward messages from other store and forward layers (e.g., store andforward layer 106) and store and forward services (e.g., store andforward services 121 and 122).

Within computer architecture 100, queue manager 118 and application 112are both depicted as residing at computer system 111. However, it wouldbe apparent to one skilled in the art, after having reviewed thisdescription, that a queue manager and application that utilizes thequeue manager can reside at different computer systems. For example,queue manager 118 can reside at some other computer system that isnetwork connectable to computer system 111. As previously described,applications at a plurality of different servers read messages from asingle queue to provide load-balancing.

Generally, the modules in computer architecture 100 can interoperate tofacilitate reliable transfer of queued application messages. Embodimentsof the present invention can utilize a variety of different protocols toimplement reliable transfer of queued application messages.

An application session management protocol can be implemented toestablish and tear down queued sessions between applications (e.g.,between application 102 and application 112). All messages within asession share associated assurances such as exactly once and in orderdelivery to the target application. Applications can use a queuedchannel API implemented in a client library to send and receive messageson a queued session. Queued session state can be persisted in acorresponding queue, whereas queued channels used for capture anddelivery are maintained in the application address space and aretransient. Session attachment and detachment mechanisms can be used todecouple the lifetime of the queued channels and the session in thequeue (e.g., as part of the capture/delivery protocol).

An acknowledgement process can send store/forward acks, transfer acks,and delivery acks, and the sender takes various actions on these. Forexample, a queue manager can stop attempting to forward messages afterreceiving a store/forward acknowledgement. Also, errors may be returnedduring transfer or delivery, which cause messages to move to a deadqueue immediately without waiting for expiration.

Generally, queued sessions are used to correlate a set of messages. Theapplication writer defines a set of messages as part of a queuedsession. Queued sessions can be long running and are uniquely identifiedby an identifier in the queue. Thus, queued sessions can outlive thelifetime of the applications that read from or write to the queuedsessions. Queued sessions are also recoverable. That is, applicationscan fail, recover and re-attach to the queued session to continue itsoperation on the session.

Applications using queued communication set reliability requirements forthe transfer of messages via a message expiration and message requestfor delivery acknowledgements. Messages can expire based on expirationtime set by the user. When messages expire, the sending side queue movesthe message to a dead queue. Delivery acknowledgements are generated bya corresponding receiving side queue manager when the receiving sideapplication successfully consumes a message. The deliveryacknowledgement is an indication to the sending side queue manager(e.g., queue manager 108) that the message was delivered successfully tothe application (e.g., application 112).

A queue capture protocol can be implemented between a queue channel(e.g., queue channel 103) and queue manager (e.g., queue manager 108) toprovide a very high likelihood of synchronous reliable transfer of anapplication message (e.g., application message 131) from a sending sideapplication (.e.g., application 102) to a sending side message queue(e.g., message queue 107). A queue capture protocol can utilize messageencapsulation to tunnel an application message in an enqueue messagerequest (e.g., enqueue message 141) to a queue manager. When anencapsulated application message is successfully written to a messagequeue, the queue manager returns an enqueue response (e.g., enqueueresponse 142) to the queue channel. An enqueue message request andcorresponding enqueue response can be part of a two-phase commitprotocol. An enqueue message request can include an atomic transactioncontext that facilitates coordination of an enqueue operation with otherapplication state changes.

A transfer protocol can be implemented between a sending queue manager(e.g., queue manager 108) and a receiving queue manager (e.g., queuemanager 118). A transfer protocol can utilize message encapsulation totunnel an application message in a transfer message (e.g., transfermessage 151) sent from one queue manager to another queue manager. Asending side queue manager facilitates initiation of a secure andreliable transfer session with a corresponding receiving side queuemanager, the correlation and sequencing of messages with a session, andthe processing of transfer acknowledgements from the receiving sidequeue manager. The receive side queue manager facilitates acceptance oftransfer sessions, receiving messages on the session, and sendingtransfer acknowledgments.

A transfer protocol can also include mechanisms for detecting holes in amessage sequence. Generally, exchanged messages- are numbered andexpired messages will cause holes in the message sequence. Accordingly,a sending side queue can send transfer cancel message to a receivingside queue to close holes in its acknowledgement range.

A store and forward protocol can be implemented to transfer messagesbetween store and forward layers (e.g., between store and forward layers106 and 116), between a store and forward intermediate and a store andforward layer (e.g., between store and forward layers 106 and store andforward service 121), and between store and forward services (e.g.,between store and forward service 121 and store and forward service122). A transfer protocol can provide an extensibility model such thatintermediate store and forward services are transparently interposedbetween a sending side queue and a receiving side queue. Messages can beforwarded through intermediate store and forward services withoutsignificantly affecting the end to end reliability of a transfermessage. A store and forward protocol can utilize message encapsulationthat encloses transfer headers and application messages in a store andforward message (e.g., forward message 161) and forwards the forwardmessage to the next hop. In response to receiving a store and forwardmessage, an appropriately configure module can return a store andforward response (e.g., forward response 162).

A delivery protocol can be implemented to deliver an application messagefrom a receiving side queue (e.g., message queue 117) to a correspondingapplication (e.g., application 112). A delivery protocol can send asession available message (e.g., session available message 172) ormessage available message (e.g., message available message 174) to aqueue listener (e.g., queue listened 113). The queue listener respondswith a dequeue message request (e.g., dequeue message 176) to read anapplication message (or other appropriate message) from the queue.Dequeueing can be performed in accordance with a Web Servicesspecification, such as, for example, WS-Enumeration. In response to adequeue message request, a queue manager (e.g., queue manager 118) cansend a dequeue response that includes an application message (or otherappropriate message). A dequeue message request and correspondingdequeue response can be part of a two-phase commit protocol. An dequeuemessage request can include an atomic transaction context thatfacilitates coordination of a dequeue operation with other applicationstate changes

A wakeup notification protocol can be implemented to wakeup a receivingside application (e.g., application 112) when an application message isavailable. For example, applications that read messages from a queue canbe hosted in a container. From time to time, an application may not berunning for a variety of reasons. For example, an application may havefailed, an application may have idled out, or recycled etc. The wakeupnotification protocol mechanism provides for notifying a hostingenvironment of the availability of messages in a queue. The hostingenvironment may use this to start the application or start anotherinstance of the application or schedule it for running.

In some embodiments, a queue manager hosts one or more queues.Accordingly, the queue manager can implement a capture, delivery,transfer and store/forward protocol for all queues it hosts. The queuemanager can be configured to multiplex queue to queue transfers betweenthe same two queue managers over a single transfer session.

As described above, protocols for implementing reliable transfer ofqueued application messages can utilize message encapsulation.Generally, message encapsulation includes wrapping (at least a portionof) a first message (e.g., an application message) in a second message(e.g., a transfer message). In some embodiments, the first and secondmessages are configured in accordance with the same messaging protocol,such as, for example, Simple Object Access Protocol (“SOAP”). Thus, itmay be that one or more of the previously described protocolsencapsulates (at least a portion of) a first SOAP envelope, such as, forexample, an eXtensible Markup Language (“XML”) element, in a second SOAPenvelope. Accordingly, encapsulation can be used to capture a SOAPapplication message in a SOAP enqueue message, to transfer a SOAPapplication message in a SOAP transfer message, and deliver a SOAPapplication message in SOAP dequeue response. A similar encapsulationmechanism can be used to encapsulate a transfer header and anapplication message in a store and forward message.

When encapsulating an inner XML element (e.g., an application SOAPenvelope) inside another XML element (e.g., a transfer SOAP envelope),the inner or wrapped XML element can be encoded (or serialized)according to a wrapping algorithm. Various encoding techniques, such as,for example, binary and text encoding can be used. In some embodiments,wrapping algorithms utilize base64 binary encoding to encode wrapped XMLelements. An XML element, such as, for example, nq:WrappedXmlBase64, canbe used to indicate the encoding type of an encoded XML element. Anencoded XML element can also have a corresponding attribute, such as,for example, nq:ContentType, that defines the original content type.Thus, wrapping facilitates the encapsulation of a (binary or text)encoded SOAP envelope inside another SOAP envelope.

An unwrapping algorithm can decode (or deserialize) an encoded XMLelement. For example, an unwrapping algorithm can provide the encodingtype and original content type to a corresponding XML reader. Thus, abase64 encoded. XML element's value can be provided to a binary. XMLreader to decode the value into the corresponding unencoded XML element.

Message encapsulation facilitates the reuse of Web Services protocolelements between different messaging layers. For example, encapsulationfacilitates the reuse of addressing, security, reliability, andtransaction protocol elements between an application layer, a transferlayer and a store and forward layer. For example, when a transfer SOAPenvelope encapsulates an encoded application SOAP envelope, composableprotocol elements of the application SOAP envelope do not interfere withcomposable protocol elements of the transfer envelope (since thecomposable elements are encoded). Yet, composable protocol elements ofthe application SOAP envelope can be efficiently accessed throughdecoding.

FIG. 2 illustrates an example flow chart of a method 200 of reliablysending a queued application message. Method 200 will be described withrespect to the modules and data in computer architecture 100.

Method 200 includes a functional result-oriented step for capturing anapplication message such that the application message is queued fordelivery to a receiving computer system (step 215). Step 215 can includeany corresponding acts for accomplishing the result of capturing anapplication message such that the application message is queued fordelivery to a receiving computer system. However, in the illustratedexample of FIG. 2, the step 215 includes a corresponding act ofreceiving an application message (act 201). For example, queue channel103 can receive application message 131 from application 102.Application message 131 can be included in a subroutine call (to queuechannel 103) for enqueueing application message 131 in a message queue.Application message 131 can be configured in accordance with a messagingprotocol, such as, for example, SOAP. Accordingly, application message131 can include an application SOAP envelope containing application datathat is to be sent to application 112. Generally, an application SOAPenvelope can be of the following format: <s:Envelope>  <s:Header>  Application Headers  </s:Header>  <s:Body>   Application Data </s:Body> </s: Envelope>

Step 215 includes a corresponding act of encoding the applicationmessage (act 202). For example, queue channel 103 can encode applicationmessage 131 (including composable protocol elements) into corresponding(e.g., binary or text) encoded application message 131E. Queue channel103 can execute a wrapping algorithm that takes an application message,an encoding type, and a content type as input and returns an encodedapplication message as output. For example, the wrapping algorithm canreceive application message 131, a base64 encoding type, and a stringcontent type as input and can return encoded application message 131E asoutput.

Queue channel 103 can optionally encrypt and/or digitally sign encodedapplication message 131E as well. Encrypting and/or digitally signingencoded application message 131 E helps ensure that the applicationmessage 131E is not modified or intercepted during transmission. Encodedapplication message 131E can be secured using any of a variety ofdifferent security mechanisms, such as, for example, WS-Security.

Step 215 includes a corresponding act of configuring an enqueue message(act 203). For example, queue channel 103 can configure enqueue message141. Enqueue message 141 can be configured in accordance with the samemessaging protocol as application message 131. Accordingly, enqueuemessage 141 can also include a SOAP envelope. Enqueue message 141 canidentify a message queue that is to queue encoded application message131E and can identify a message session corresponding to applicationmessage 131. For example, enqueue message 141 can identify message queue117 and can identify a message session between application 102 andapplication 112. Queue manager 108 can use message queue 107 as atransfer queue.

Since composable protocol elements (e.g., addressing, security,reliability, and transaction protocol elements) of application message131 are encoded, the composable protocol elements of application message131 do not interfere with the configuration of enqueue message 141.Accordingly, any composable protocol elements included in applicationmessage 131 can be reused in enqueue message 141.

Step 215 includes a corresponding act of encapsulating the encodedapplication message in the enqueue message (act 204). For example, queuechannel 103 can encapsulate encoded application message 131E in enqueuemessage 141. Generally, an enqueue message can be of the format (beforebeing secured): <s:Envelope ...>  <s:Header>  <wsa:Actions:mustUnderstand=”true”>  http://schemas.testcorp.com/queuing/EnqueueMessage  </wsa:Action> <wsa:To>xs:anyURI</wsa:To>  <wscoor:CoordinationContexts:mustUnderstand=”true”> ... </wscoor:CoordinationContext> ? <nq:QueueName>xs:anyURI</nq:QueueName> <wsa:ReplyTo>wsa:EndpointReferenceType</wsa:ReplyTo> <wsa:MessageID>xs:anyURI</wsa:MessageID>  <nq:Sequence Ordered=”1”? >  <wsu:Identifier>xs:anyURI</wsu:Identifier>   <wsrm:MessageNumber>xs:unsignedlong</    wsrm:MessageNumber> ?  <wsrm:LastMessage /> ?  </nq:Sequence> ? <wsu:Expires>xsd:dateTime</wsu:Expires>  <nq:Volatile /> ? <nq:ErrorQueueName>xs:anyURI</nq:ErrorQueueName> ?  ...  </s:Header> <s:Body>  <nq:EnqueueMessage>   <nq:ApplicationMessage>  <nq:WrappedXmlBase64 nq:ContentType=”xs:string”>    binary base64wrapped message   </nq:WrappedXmlBase64>   </nq:ApplicationMessage> </nq:EnqueueMessage>  </s:Body> </s:Envelope

Within an enqueue message, the /s:Envelope/s:Header/nq:Sequence elementcan be used to associate the enqueue message with an applicationsession. The /s:Envelope/s:Header/nq:Sequence/@Ordered element can beused to indicate if the application session is ordered (e.g., “1” or“true” indicates an ordered application session). The/s:Envelope/s:Header/nq:Sequence/wsu:Identifier element can be used tocontain the session identifier. The/s:Envelope/s:Header/nq:Sequence/wsrm:MessageNumber element can be usedto contain the sequence number of the (encoded) application message inthe application session. Sequence numbers start at an initiate value,such as, for example, 1, and increment, such as, for example, by 1. The/s:Envelope/s:Header/nq:Sequence/wsrm:LastMessage element can be used toindicate the (encoded) application message is the last message for theapplication session.

The /s:Envelope/s:Header/wscoor:CoordinationContext element can be usedto indicate if the enqueue message is to be executed as part of anatomic transaction. If so, the/s:Envelope/s:Header/wscoor:CoordinationContext element can contain theatomic transaction context. The /s:Envelope/s:Header/nq:QueueNameelement can be used to indicate a reference parameter containing thename (URI) of the logical queue the listener (e.g., queue listener 113)wants to listen to. The /s:Envelope/s:Header/wsu:Expires element can beused to indicate the expiration timestamp for the (encoded) applicationmessage. The /s:Envelope/s:Header/nq:Volatile element can be used toindicate that the (encoded) application message need not be written to apersistent store in order to have its delivery be acknowledged. The/s:Envelope/s:Header/wsu:ErrorQueueName element can be used to indicatethe queue name URI of the logical queue the (encoded) applicationmessage should be written to in case of a delivery error. The/s:Envelope/s:Body/*/nq:WrappedXmlBase64 element contains the completeSOAP envelope of the (encoded) application message, appropriatelywrapped. The /s:Envelope/s:Body/*/nq:WrappedXmlBase64/@nq:ContentTypeelement indicates the content type of the (encoded) application message.

Subsequent to encapsulating encoded application message 131E, enqueuemessage 141 can be encrypted and/or digitally signed. Digitally signingenqueue message 141 provides queue manager 108 some assurance of theauthenticity of enqueue message 141 and can prevent injecting additionalmessages into message queue 107. Enqueue message 141 can be securedusing any of a variety of different security mechanisms includingWS-Security or transport layer security, such as, for example, SecureSockets Layer (“SSL”).

Step 215 includes a corresponding act of sending the enqueue message toqueue the encoded application message (act 205). For example, queuechannel 103 can send enqueue message 141 to queue manager 108. Whenappropriate, queue channel 103 can encrypt enqueue message 141 beforesending enqueue message 141 to queue manager 108. Queue manager 108controls message queue 107 and can queue encoded application message 131E for delivery to application 112.

Queue manager 108 can receive enqueue message 141 and store encodedapplication message 131E in message queue 107

Subsequent to storing encoded application message 131E in message queue107, queue manager 108 can send enqueue response 142 (potentiallyencrypted and/or digitally signed) to queue channel 103 to acknowledgereceipt of enqueue message 141. Queue channel 103 can receive enqueueresponse 142. Enqueue response 142 indicates to queue channel 103 thatqueue manager 108 successfully queued encoded application message 131E.Generally, an enqueue response can be of the format (before beingsecured): <s:Envelope ...>  <s:Header>  <wsa:Action>  http://schemas.testcorp.com/queuing/EnqueueMessageResponse </wsa:Action>  <wsa:To>xs:anyURI</wsa:To>  <wsa:RelatesTo>requestmessage ID</wsa:RelatesTo>  <wsa:MessageID>xs:anyURI</wsa:MessageID> ...   </s:Header>   <s:Body /> </s:Envelope>

Generally, elements in an enqueue response have the same meaning aspreviously described with respect to an enqueue message. Further, theelement /s:Envelope/s:Header/wsa:RelatesTo can be used to relate anenqueue response to a corresponding enqueue message. For example,enqueue response 142 can include a relates to value that identifiesenqueue message 141. In some embodiments, an enqueue message andcorresponding enqueue response are part of a two-phase commit protocol.

Method 200 includes a functional result-oriented step for transferringthe application message to a receiving computer system (step 216). Step216 can include any corresponding acts for accomplishing the result oftransferring the application message to a receiving computer system.However, in the illustrated example of FIG. 2, the step 216 includes acorresponding act of dequeueing an encoded application message (act206). For example, transfer layer 107 can dequeue encoded applicationmessage 131E from message queue 107.

Step 216 includes a corresponding act of configuring a transfer message(act 207). For example, transfer layer 104 can configure transfermessage 151A. Transfer message 151A can be configured in accordance withthe same messaging protocol as application message 131. Accordingly,transfer message 151A can also include a SOAP envelope. Transfer message151A can identify a message session corresponding to the encodedapplication message 131E and can identify a receiving computer systemthat is participating in the message session. For example, transfermessage 151A can identify a message session between application 102 andapplication 112.

Transfer layer 104 can decrypt any encrypted portions of the enqueuemessage 141 (e.g., encrypted as per WS-Security) and reconstitute theclear text of enqueue message 141. Transfer layer 104 copies appropriateheaders, such as, for example, nq:QueueName; nq:Volatile; wsu:Expires;nq:Sequence, from enqueue message 141 to transfer message 151A. If anapplication session identifier element, such as, for example,nq:Sequence, is present, transfer layer 104 calculates the nextsequential message number for this session, adds it to the nq:Sequenceelement as the value of the MessageNumber element, and updates any localstate.

Since composable protocol elements (e.g., addressing, security,reliability, and transaction protocol elements) of application message131 are encoded, the composable protocol elements of application message131 do not interfere with the configuration of transfer message 151A.Accordingly, any composable protocol elements included in applicationmessage 131 can be reused in transfer message 151A.

Transfer layer 104 can optionally encrypt and/or digitally sign transfermessage 151A. Securing transfer message 151A provides queue manager 108some assurance of the authenticity of transfer message 151A and canprevent injecting additional messages into message queue 107. Transfermessage 151A can be secured using any of a variety of differentsecurity, such as, for example, WS-Security.

Step 216 includes a corresponding act of encapsulating the encodedapplication message in the transfer message (act 208). For example,transfer layer 104 can encapsulate encoded application message 131E intransfer message 151A. Thus, in some embodiments, transfer layer 104copies the nq:ApplicationMessage body element of enqueue message 141 tothe body of the transfer message 151A. Generally, a transfer message canbe of the format (before being secured): <s:Envelope>  <s:Header> <wsa:Action>   http://schemas.testcorp.com/queuing/TransferMessage </wsa:Action>  <wsa:To>xs:anyURI</wsa:To> <nq:QueueName>xs:anyURI</nq:QueueName> <wsa:ReplyTo>wsa:EndpointReferenceType</wsa:ReplyTo> <wsa:MessageID>xs:anyURI</wsa:MessageID>  <nq:Sequence Ordered=”1”? >  <wsu:Identifier>xs:anyURI</wsu:Identifier>  <wsrm:MessageNumber>xs:unsignedLong</wsrm:MessageNumber>  <wsrm:LastMessage /> ?  </nq:Sequence> ? <wsu:Expires>xsd:dateTime</wsu:Expires>  <nq:Volatile /> ? <nq:ErrorService>wsa:EndpointReferenceType</nq:ErrorService> </s:Header>  <s:Body>  <nq:TransferMessage>   <nq:ApplicationMessage>  <nq:WrappedXmlBase64 nq:ContentType=”xs:string”>    binary base64wrapped message   </nq:WrappedXmlBase64>   </nq:ApplicationMessage> </nq:TransferMessage>  </s:Body> </s:Envelope>

Generally, elements in a transfer message have the same meaning aspreviously described with respect to an enqueue message and enqueueresponse. Additionally, the /s:Envelope/s:Header/wsu:ErrorServiceelement can be used to indicate a location the (encoded) applicationmessage should be sent to in case of a delivery error.

Step 216 includes a corresponding act of sending the transfer messagefor delivery to the receiving computer system (act 209). For example,transfer layer 104 can send transfer message 151 A for delivery toapplication 112.

Method 200 includes a functional result-oriented step for forwarding theapplication message toward the receiving computer system (step 217).Step 217 can include any corresponding acts for accomplishing the resultof forwarding the application message toward the receiving computersystem. However, in the illustrated example of FIG. 2, the step 217includes a corresponding act of accessing a transfer message (act 210).For example, store and forward layer 106 can access transfer message 151A.

Step 217 includes a corresponding act of encoding a transfer header fromthe transfer message (act 211). For example, store and forward layer 106can encode transfer header 152 into encoded transfer header 152E. Storeand forward layer 106 can execute a wrapping algorithm that takes anencoding type (e.g., base64), a content type (e.g., string), and atransfer header as input and returns an encoded transfer header asoutput. In some embodiments, other portions of transfer message 151A arealso encoded.

Step 217 includes a corresponding act of configuring a store and forwardmessage (act 212). For example, store: and forward layer 106 canconfigure forward message 161. Forward message 161 can be configured inaccordance with the same messaging protocol as application message 131.Accordingly, forward message 161 can also include a SOAP envelope.Forward message 161 can be for delivery to a next store and forwardservice (or store and forward layer) based on the position ofapplication 102 (or computer system 101) relative to application 112 (orcomputer system 111) within comptuer architecture 100. Store and forwardlayer 106 copies appropriate headers from transfer message 151A, suchas, for example, an nq:Volatile header, into forward message 161.

Since composable protocol elements (e.g., addressing, security,reliability, and transaction protocol elements) of application message131 and transfer message 151A are encoded, the composable protocolelements of application message 131 and transfer message 151A do notinterfere with the configuration of store and forward message 161.Accordingly, any composable protocol elements included in applicationmessage 131 and (e.g., the headers of) transfer message 151A can bereused in forward message 161

Step 217 includes a corresponding act of encapsulating the encodedtransfer header and encoded application message into the store andforward message (act 213). For example, store and forward layer 106 canencapsulate encoded transfer header 152E and encoded application message131E into forward message 161. When appropriate, other portions oftransfer message 151A can also be encapsulated.

Store and forward layer 106 can encode the s:Header element of transfermessage 151A and encapsulate the encoded s:Header as a child elementnamed nq:WrappedXmlBase64 of an nq:TransferHeader body element. Storeand forward layer 106 can also copy an nq:ApplicationMessage bodyelement of the transfer message 151A to forward message 161. Generally,a store and forward message can be of the format (before B beingsecured): <s:Envelope>  <s:Header>  <wsa:Action>  http://schemas.testcorp.com/queuing/ForwardMessage  </wsa:Action> <wsa:To>xs:anyURI</wsa:To>  <nq:Volatile /> ?  </s:Header>  <s:Body> <nq:ForwardMessage>   <nq:TransferHeader>   <nq:WrappedXmlBase64nq:ContentType=”xs:string”>    binary base64 wrapped transfer header  </nq:WrappedXmlBase64>   </nq:TransferHeader>  <nq:ApplicationMessage>   <nq:WrappedXmlBase64nq:ContentType=”xs:string”>    binary base64 wrapped message  </nq:WrappedXmlBase64>   </nq:ApplicationMessage> ? </nq:ForwardMessage>  </s:Body> </s:Envelope>

Generally, elements in a store and forward message have the same meaningas previously described with respect to an enqueue message, an enqueueresponse, and a transfer message. Additionally, the/s:Envelope/s:Header/nq:Volatile element can be used to indicate thatthe store and forward message not be written to a persistent store inorder to have its delivery be acknowledged. The

/s:Envelope/s:Body/*/nq:TransferHeader/nq:WrappedXmlBase64 element canbe used to indicate the encapsulated s:Header element of a transfermessage assembled by the sending queue service. The/s:Envelope/s:Body/*/nq:ApplicationMessage/nq:WrappedXmlBase64 elementcan be used to indicate an encapsulated application message,appropriately wrapped.

Store and forward layer 106 can store encoded transfer header 152E (andpotentially other encoded portions of transfer message 151A) and encodedapplication message 131E in a temporary storage locaiton.

Step 217 includes a corresponding act of forwarding the store andforward message to the next store and forward service (act 214). Forexample, store and forward layer 106 can forward forward message 161 tostore and forward service 121. Alternately, store and forward service121 can identify a receiving store and forward layer (e.g., store andforward layer 116). When appropriate, store and forward layer 106 canencrypt and/or digitally sign forward message 161 before sending forwardmessage 161 to a store and forward service or other store and forwardlayer. Securing forward message 161 helps prevent unauthorized readersfrom accessing forward message 161. Forward messages 161 can be securedusing any of a variety of different security mechanisms includingWS-Security or transport layer security, such as, for example, SecureSockets Layer (“SSL”).

FIG. 3 illustrates an example flow chart of a method 300 of reliablyforwarding a queued application message. Method 300 will be describedwith respect to the modules and data in comptuer architecture 100.

Method 300 includes an act of accessing a store and forward message (act301). For example, store and forward service 121 can receive forwardmessage 161. As previously described, forward message 161 can be a SOAPenvelope that encapsulates encoded transfer header 152E (and potentiallyother portions of transfer message 151A) and encoded applicationmessage131E (for delivery to application 112). When appropriate, storeand forward service 121 can decrypt any encrypted portions of theforward message 161 (e.g., encrypted as per WS-Security) and can decodea digital signature to can confirm the integrity of forward message 161.Appropriately decrypted and authenticated portions of forward message161 can be used to reconstitute the clear text of forward message 161.

When appropriate, for example, when a forward message does not containan nq:Volatile header, an encoded transfer header (and potentially otherencoded portions of a transfer message and an encoded applicationmessage can be stored at store and forward service or a store andforward layer. For example, store and forward service 121 can storeencoded transfer header 152E and encoded application message 131E intemporary storeage. Also when appropriate, a store and forward serviceor store and forward layer can acknowledge receipt of a forward messagewith a store and forward response. For example, store and forwardservice 121 can send forward response 162 (potentially encrypted and/ordigitally signed) to store and forward layer 106 to acknowledge receiptof forward message 161. Store and forward layer 106 can receive andpotentially decrypt and/or authenticate forward response 162. Inresponse to forward response 162, store and forward layer 106 can removeencoded transfer header 152E (and potentially other portions oftransfer-message 151A) and encoded application message 131E fromtemporary storage.

Generally, a store and forward response can be of the format (beforebeing secured): <s:Envelope>  <s:Header>  <wsa:Action>  http://schemas.testcorp.com/queuing/ForwardMessageResponse </wsa:Action>  <wsa:To>xs:anyURI</wsa:To>  <wsa:RelatesTo>originalmessage ID</wsa:RelatesTo>  </s:Header>  <s:Body /> </s:Envelope>

Generally, elements in a store and forward response have the samemeaning as previously described with respect to an enqueue message, anenqueue response, a transfer message, and a store and forward message.Additionally, the element /s:Envelope/s:Header/wsa:RelatesTo can be usedto relate an store and forward response to a corresponding store andforward message. For example, forward response 162 can include a relatesto value that identifies store and forward message 161. Store andforward layer 106 can receive forward response 162 indicatingacknowledgement of forward message 161.

Method 300 includes an act of identifying a next store forward service(act 302). For example, store and forward service 121 can identify storeand forward service 122 based on the location of store and forwardservice 121 relative to application 112 (or computer system 111) incomputer architecture 100. Alternately, store and forward service 121can identify a store and forward layer (e.g., store and forward layer116). Store and forward service 121 can refer to the headers of forwardmessage 161 when identifying a next store and forward service or storeand forward layer.

Method 300 includes an act of configuring a new store and forwardmessage (act 303). For example, store and forward service 121 canconfigure forward message 163. Forward message 163 can be configured inaccordance with the same messaging protocol as application message 131.Accordingly, forward message 161 can also include a SOAP envelope.Forward message 163 can be for delivery to a next store and forwardservice (or store and forward layer) based on the position ofapplication 102 (or computer system 101) relative to application 112 (orcomputer system 111) within comptuer architecture 100. Store and forwardservice 121 can copy appropriate headers, such as, for example, andnq:Volatile header, from forward message 161 to forward message 163.

Since composable protocol elements (e.g., addressing security,reliability, and transaction protocol elements) of application message131 and transfer message 151A are encoded, the composable protocolelements of application message 131 and transfer message 151A do notinterfere with the configuration of store and forward message 163.Accordingly, any composable protocol elements included in applicationmessage 131 and header 152 (or other portions of transfer message 151A)can be reused in forward message 163.

Method 300 includes an act of copying the body of the store and forwardmessage into the body of the new store and forward message (act 304).For example, store and forward service 121 can copy encoded transferheader 152E (and potentially other portions of transfer message 151A)and encoded application message 131E from forward message 161 to forwardmessage 163.

When appropriate, store and forward service 121 can encrypt and/ordigitally sign forward message 163 before sending forward message 163 toa next store and forward service or other store and forward layer.Securing forward message 163 helps prevent unauthorized readers fromaccessing forward message 163. Forward messages 163 can be secured usingany of a variety of different security mechanisms including WS-Securityor transport layer security, such as, for example, Secure Sockets Layer(“SSL”).

Method 300 includes an act of forwarding the new store and forwardmessage to the next store and forward service (act 305). For example,store and forward service 121 can forward forward message 163 to storeand forward service 122. Alternately, store and forward service 121 canforward forward message 163 to a store and forward layer (e.g., storeand forward layer 116). When appropriate, store and forward service 121can encrypt forward message 163 before sending forward message 163 tostore and forward service 122. Generally, forward message 163 can beformatted similar to forward message 161.

Store and forward service 122 can receive forward message. 163. Whenappropriate, store and forward service 122 can decrypt and/or verify theintegrity of forward message 163 as previously described. Store andforward service can store encoded transfer header 152E and encodedapplication message 131E in temporary storage. Store and forward service122 can also send forward response 164 (potentially encrypted and/ordigitally signed) to store and forward service 121 to acknowledgereceipt of forward message 163. Store and forward service 121 canreceive and potentially decrypt and/or authenticate forward response164. In response to forward response 164, store and forward service 121can remove encoded transfer header 152E (and potentially other portionsof transfer message 151A) and encoded application message 131E fromtemporary storage. Generally, forward response 164 can be formattedsimilar to forward response 162.

Store and forward service 122 can also configure store and forwardmessage 166 (a new store and forward SOAP envelope) for delivery tostore and forward layer 116. Store and forward layer 122 can processstore and forward message 163 (e.g., identifying a next store andforward module, etc) similar to store and forward service 121'sprocessing of forward message 161. Accordingly, store and forwardservice 122 can copy encoded transfer header 152E (and potentially otherportions of transfer message 151A) and encoded application 131E fromforward message 164 to forward message 166. Store and forward service122 can send forward message 166 (potentially encrypted and/or digitallysigned) to store and forward layer 116. Generally, forward message 166can be formatted similar to forwards messages 161 and 163.

Since composable protocol elements (e.g., addressing, security,reliability, and transaction protocol elements) of application message131 and transfer message 151A are encoded, the composable protocolelements of application message 131 and transfer message 151A do notinterfere with the configuration of store and forward message 166.Accordingly, any composable protocol elements included in applicationmessage 131 and header 152 (and other portions of transfer message 151A)can be reused in forward message 166.

FIG. 4 illustrates an example flow chart of a method 400 of reliablyreceiving a queued application message. The method 400 will be describedwith respect to the modules and data in comptuer architecture 100.

Method 400 includes a functional result-oriented step for forwarding anapplication message from a sending computer system (step 419). Step 419can include any corresponding acts for accomplishing the result offorwarding an application message from a sending computer system.However, in the illustrated example of FIG. 4, the step 419 includes acorresponding act of receiving a store and forward message (act 401).

For example, store and forward layer 116 can receive forward message166. When appropriate, store and forward layer 116 can decrypt anyencrypted portions of the forward message 163 (e.g., encrypted as perWS-Security) and can decode a digital signature to can confirm theintegrity of forward message 166. Appropriately decrypted andauthenticated portions of forward message 166 can be used toreconstitute the clear text of forward message 166. Store and forwardlayer can store encoded transfer header 152E (and potentially otherportions of transfer message 151A) and encoded application message 131Ein temporary storage.

Store and forward layer 116 can also send forward response 167(potentially encrypted and/or digitally signed) to store and forwardservice 122 to acknowledge receipt of forward message 166. Store andforward service 122 can receive and potentially decrypt and/orauthenticate forward response 167. In response to forward response 167,store and forward service 122 can remove encoded header 152E (andpotentially other portions of transfer message 151A) and encodedapplication message 131E from temporary storage. Generally, forwardresponse 167 can be formatted similar to forward responses 164 and 162.

As previously described, forward message 166 can be a SOAP envelope thatencapsulates encoded transfer header 152E (and potentially otherportions of transfer message 151A) and encoded application message 131E(for delivery to application 112). Encoded application message 131E canbe for delivery to application 112 based at least in part on application102 and application 112 participating in a communication session.

Step 419 includes a corresponding act of decoding the encoded transferheader (act 402). For example, store and forward layer 116 can decodeencoded transfer header 152E into a corresponding (unencoded) transferheader 152 (e.g., a/s:Envelope/s:Body/*/nq:TransferHeaders/nq:WrappedXmlBase64 element).Store and forward layer 116 can execute an unwrapping algorithm thattakes an encoding type (e.g., base64), a content type (e.g., string),and an encoded transfer header as input and returns an (unencoded)transfer header. When appropriate, store and forward layer 116 can alsodecode other portions of transfer message 151A.

Step 419 includes an act of configuring a transfer message (act 403).For example, store and forward layer 116 can configure transfer message151B. Transfer message 151B can be configured in accordance with thesame messaging protocol as application message 131. Accordingly,transfer message 151B can also include a SOAP envelope. Transfer message151B can identify a message session corresponding to the encodedapplication message 131E and can identify an application that isparticipating in the message session. For example, transfer message 151Bcan identify a message session between application 102 and application112. In some embodiments, transfer message 151A is reconstituted fromits encapsulation within forward message 166 and thus transfer message151A and 151B are essentially the same transfer message.

Since composable protocol elements (e.g., addressing, security,reliability, and transaction protocol elements) of application message131 are encoded, the composable protocol elements of application message131 do not interfere with the configuration of transfer message 151B.Accordingly, any composable protocol elements included in applicationmessage 131 can be reused in forward message 151B. Generally, transfermessage 151B can be formatted similar to transfer message 151A.

Step 419 includes a corresponding act of including the transfer headerin the transfer message (act 404). For example, store and forward layer116 can include transfer header 152 in transfer message 151B. Transferheader 152 can indicate how transfer message 151B is to be transferredto application 112.

Step 419 includes a corresponding act of encapsulating the encodedapplication message in the transfer message (act 405). For example,store and forward layer 116 can encapsulate encoded application message131E in transfer message 151B. Store and forward layer 116 canoptionally encrypt and/or digitally transfer message 15 1B. Securingtransfer message 151B provides queue manager 118 some assurance of theauthenticity of transfer message 151B and can prevent injectingadditional messages into message queue 117. Transfer message 151B can besecured using any of a variety of different security mechanisms, suchas, for example, WS-Security.

Step 419 includes an corresponding act of sending the transfer message(act 406). For example, store and forward layer 116 can (appropriatelyencrypt and) send transfer message 151B to transfer layer 114.Generally, transfer message 151B can be formatted similar to transfermessage 151 A.

Method 400 includes a functional result-oriented step for transferringan application message from a sending comptuer system (step 420). Step420 can include any corresponding acts for accomplishing the result oftransferring an application message from a sending comptuer system.However, in the illustrated example of FIG. 4, the step 420 includes acorresponding act of processing a transfer message (act 407). Forexample, transfer layer 114 can process transfer message 151B. Transfermessage 151B can encapsulate encoded application message 131E and beconfigured in accordance with the same messaging protocol as applicationmessage 131. Accordingly, transfer message 151B can also include a SOAPenvelope.

Transfer layer 114 can decrypt and confirm the integrity of portions oftransfer message 151B as appropriate (e.g., in accordance withWS-security), Decrypting transfer message 151B can reveal the clear textof message 151B. When appropriate, transfer layer 114 performs localprocessing to ensure in-order deliver, for example, in accordance withan nq:Sequence header having the Ordered attribute set to a true value(“1” or “true”). Transfer layer 114 compares the wsu:Expires headervalue to the current date-time to see if the application message 131 isstill valid. If not, the receiving queue service can fail the requestand generate an appropriate fault, such as, for example:

-   -   [Code] s12:Receiver    -   [Subcode] nq:MessageExpired    -   [Reason] “the message has expired”

In some embodiments, transfer layer 114 may need to generate anappropriate fault after it has accepted and acknowledged the message, ifno queue listener dequeues the message before it expires. In theseembodiments, the fault can be supplemented by copying the nq:Sequenceand nq:QueueName headers to the fault's s:detail element.

Transfer layer 114 can also durably store encoded application message131E in message queue 117.

Step 420 includes a corresponding act of enqueueing the encodedapplication message (act 408). For example, transfer layer 114 canenqueue encoded application message 131E in message queue 117. Transferlayer 114 can retain queuing headers (nq:QueueName; wsu:Expires; andnq:Sequence) and the nq:ApplicationMessage body element of theTransferMessage envelope for further processing (e.g., dequeueing fordelivery to application 112).

In some embodiments, queue listeners register interest in receivingnotifications about sessions available on a queue. For example, queuelistener 113 can send registration message 191 to queue manager 118 toregister an interest in messages available on message queue 117.Registration message 191 can represent that application 112 isinterested in sessions and messages from application 102. Generally, aregistration message can be of the format (before being secured):<s:Envelope ...>  <s:Header>  <wsa:Action>  http://schemas.microsoft.com/queuing/Listen  </wsa:Action> <wsa:To>xs:anyURI</wsa:To> <wsa:ReplyTo>wsa:EndpointReference</wsa:ReplyTo> <wsa:MessageID>xs:anyURI</wsa:MessageID> <nq:QueueName>xs:anyURI</nq:QueueName>  <nq:Volatile /> ?  ... </s:Header>  <s:Body>  <nq:Listen>   <nq:Filter>XPathpredicate</nq:Filter> ?  </nq:Listen>  </s:Body> </s:Envelope>

Generally, elements in a registration message have the same meaning aspreviously described with respect to an enqueue message, an enqueueresponse, a transfer message, a store and forward message, and a storeand forward response. Additionally, the/s:Envelope/s:Header/nq:QueueName element can be used to indicate thename (URI) of the logical queue the queue listener wants to listen to.When there is no queue named by the nq:QueueName value in the registerrequest, the queue service can generate a appropriate fault:

-   -   [Code] s12:Sender    -   [Subcode] nq:NoSuchQueue    -   [Reason] “no such queue exists”

The /s:Envelope/s:Header/nq:Volatile element can be used to indicatethat the queue listener is interested in application sessions that areconsidered volatile. That is, to indicate an interest in applicationsessions whose messages may not be written to persistent storage. Ifthis element does not appear, then the listener will only be notified ofdurable application sessions. The /s:Envelope/s:Body/*/nq:Filter elementcan be used to indicate an XML Path Language (“XPath”) predicate that aqueue listener uses to restrict the application sessions it isinterested in. The predicate can be applied to the first message in anapplication session and the queue listener will only be notified if thepredicate evaluates to true. If this element does not appear, then thequeue listener can be notified of all application sessions.

In response to receiving a registration message from a queue listener, acorresponding queue manager 118 can generate and send a registrationresponse. For example, in response to receiving registration message191, queue manager 118 can send registration response 192 to queuelistener 113. Registration response 192 indicates a successfulregistration. Generally, a registration response can be of the format(before being secured): <s:Envelope ...>  <s:Header>  <wsa:Action>  http://schemas.microsoft.com/queuing/ListenResponse  </wsa:Action> <wsa:To>xs:anyURI</wsa:To>  <wsa:RelatesTo>request messageID</wsa:RelatesTo>  <wsa:MessageID>xs:anyURI</wsa:MessageID>  ... </s:Header>  <s:Body>  <nq:ListenResponse>  <nq:Identifier>xs:anyURI</nq:Identifier>  </nq:ListenResponse> </s:Body> </s:Envelope>

Generally, elements in a registration response have the same meaning aspreviously described with respect to an enqueue message, an enqueueresponse, a transfer message, a store and forward message, a store andforward response, and a registration message. Additionally, the/s:Envelope/s:Body/*/nq:Identifier element can be used contain a URIthat identifies a specific Listen context. For example, it correlates tothe Filter that was provided in the Listen request. This identifier isused when the listener is notified of the availability of a newapplication session or session message and when the listener accepts anapplication session.

Further, it may be that application message 131 is the initial messagein a communication session. Thus, in response to receiving applicationmessage 131 (a message queue listener 113 has registered for), queuemanager 118 can determine that queue listener 113 has registered aninterest in application message 131. For example, queue manager 118 canmatch message 113 to an XPath predicate included in registration message191. Thus in response to receiving message 131, queue manager 118 canconfigure and send session available message 172 to queue listener 113.Generally, a session available message (e.g., a SOAP envelope) caninclude a header of the following format: <nq:SessionAvailable> <nq:QueueName>xs:anyURI</nq:QueueName> <nq:Identifier>xs:anyURI</nq:Identifier> <nq:SessionAvailable>

Generally, elements in a session available message have the same meaningas previously described with respect to an enqueue message, an enqueueresponse, a transfer message, a store and forward message, a store andforward response, a registration message, and a registration response.Additionally, the nq:SessionAvailable/nq:QueueName element can be usedto indicate the URI that names the logical queue that the session isavailable on. The nq:SessionAvailable/nq:Identifier can be used toindicate an identifier returned in a registration response to the queuelistener, which the queue listener has successfully accepted, and onwhich a message is available.

Queue listener 113 can receive session available message 172. Inresponse to session available message 172, queue listener configures andsends session accept message 173. Accept message 173 contains anenumeration context (e.g., according to WS-enumeration) used to dequeuemessages. Generally, a session accept message can be of the format(before being secured): <s:Envelope ...>  <s:Header>  <wsa:Action>  http://schemas.microsoft.com/queuing/Accept  </wsa:Action> <wsa:To>xs:anyURI</wsa:To> <wsa:ReplyTo>wsa:EndpointReference</wsa:ReplyTo> <wsa:MessageID>xs:anyURI</wsa:MessageID> <nq:QueueName>xs:anyURI</nq:QueueName>  ...  </s:Header>  <s:Body> <nq:Accept>   <nq:Identifier>xs:anyURI</nq:Identifier>  <nq:MaxTime>xs:duration</nq:MaxTime> ?  </nq:Accept>  </s:Body></s:Envelope>

Generally, elements in a session accept message have the same meaning aspreviously described with respect to an enqueue message, an enqueueresponse, a transfer message, a store and forward message, a store andforward response, a registration message, a registration response, and asession available message. Additionally, the/s:Envelope/s:Header/nq:QueueName element contains the name (URI) of thelogical queue the listener wants to receive messages on. If there is noqueue named by the nq:QueueNamevalue in the registration request, thequeue manager can generate the following appropriate fault:

-   -   [Code] s12:Sender    -   [Subcode] nq:NoSuchQueue    -   [Reason] “no such queue exists”

The /s:Envelope/s:Body/*/nq:Identifier element can be used to containthe identifier returned in a registration response to the queuelistener. If an nq:Identifier value in the request is not recognized bythe receiving queue service, the queue service can generate thefollowing appropriate fault:

-   -   [Code] s12:Sender    -   [Subcode] nq:NoSuchListener    -   [Reason] “no such Listen identifier exists”

The /s:Envelope/s:Body/*/nq:MaxTime element can be used to indicate themaximum amount of time the queue listener is configured to wait for anapplication session to become available. When this element is present,the receiving queue service can generate the following appropriate faultif no application session that matches the registration identifierbecomes available by the end of the duration (measured from when thereceiving queue service processes the session accept message):

-   -   [Code] s12:Receiver    -   [Subcode] nq:NoSessionAvailable    -   [Reason] “no matching application session available”

Note that the queue listener may not rely on precise timing of thisfault, as the receiving queue service may not be able to detect thesituation and issue the fault immediately at the expiration of theduration.

In response to session accept message 173, queue manager 118 canconfigure and send session accept response 193. Generally, a sessionaccept response can be of the format (before being secured): <s:Envelope...>  <s:Header>   <wsa:Action>   http://schemas.microsoft.com/queuing/AcceptResponse   </wsa:Action>  <wsa:To>xs:anyURI</wsa:To>  <wsa:ReplyTo>wsa:EndpointReference</wsa:ReplyTo>  <wsa:MessageID>xs:anyURI</wsa:MessageID>   ...  </s:Header>  <s:Body>  <nq:AcceptResponse>   <wsen:EnumerationContext>...</wsen:EnumerationContext>  </nq:AcceptResponse>  </s:Body> </s:Envelope>

Generally, elements in a session accept response have the same meaningas previously described with respect to an enqueue message, an enqueueresponse, a transfer message, a store and forward message, a store andforward response, a registration message, a registration response, asession available message, and a session accept message. Further, the/s:Envelope/s:Body/*/wsen:EnumerationContext element can be used tocontain an XML representation of a new enumeration context, for example,in accordance with WS-Enumeration. The receiving application can passthis XML data in dequeue message requests for this application session,until and unless a dequeue response updates the enumeration context.

Referring now back to FIG. 4, Step 420 includes an act of sending amessage available message (act 409). For example, queue manager 118 cansend (potentially encrypted and/or digitally signed) message availablemessage 174 to queue listener 113. Message available message 174indicates to queue listener 113 that encoded application message 131 hasbeen queued. Message available message 174 can be sent to queue listener113 after queue listener 113 has registered an interest in messagesqueued at message queue 117 and/or after queue listener 113 has accepteda corresponding session. Generally, a message available message (e.g., aSOAP envelope) can include a message available header of the followingformat: <nq:MessageAvailable>  <nq:QueueName>xs:anyURI</nq:QueueName> <nq:Identifier>xs:anyURI</nq:Identifier> <nq:MessageAvailable>

The nq:Message Available/nq:QueueName element can be used to indicatethe URI that names the logical queue that the message is available on.The nq:MessageAvailable/nq:Identifier can be used to indicate anidentifier returned in a registration response to the queue listener,which the queue listener has successfully Accepted, and on which amessage is available. In some embodiments, a message available headermay be added to a session accept response or a dequeue response, or itmay be sent as a stand-alone one-way message, with an empty body. If itis sent as a stand-alone message, it can be sent with a wsa:Action ofhttp://schemas.testcorp.com/queuing/MessageAvailable. If sent as aheader on another message, multiple MessageAvailable headers may beincluded in a single message; they may also be mixed with one or moresession available headers.

Method 400 includes a functional result-oriented step for delivering anapplication message from a sending comptuer system (step 421). Step 421can include any corresponding acts for accomplishing the result ofdelivering an application message from a sending comptuer system.However, in the illustrated example of FIG. 4, the step 421 includes acorresponding act of receiving a message available message (act 410).For example, queue listener 113 can receive message available message174 indicating that message 131 is available for delivery to application112. When appropriate, queue listener can decrypt and/or verify theintegrity of message available message 174.

Step 421 includes a corresponding act of sending a dequeue message (act411). For example, queue listener 112 can send (potentially encryptedand/or digitally signed) dequeue message 176 to queue manager 118.Dequeue message 176 can indicate that application message 131 is to bedequeued for delivery to application 112. Dequeue message 176 caninclude elements that identify message queue 117 (e.g., nq:QueueName)and application message 131 (e.g., nq:Sequence). Generally, a dequeuemessage (e.g., a SOAP envelope) can be of the format of a WS-Enumerationpull message having additional constraints.

Generally, elements in a dequeue message have the same meaning aspreviously described with respect to an enqueue message, an enqueueresponse, a transfer message, a store and forward message, a store andforward response, a registration message, a registration response, asession available message, a session accept message, and messageavailable message. Further, a dequeue message can include a/s:Envelope/s:Header/nq:AbortCount element that can be used to indicatea retry count for poisoned-message detection. A dequeue message caninclude a /s:Envelope/s:Header/wscoor:CoordinationContext element thatcan be used to indicate an atomic transaction contest (e.g., whendequeue message 176 and dequeue response 177 are part of a two-phasecommit protocol). A dequeue message can include a/s:Envelope/s:Body/*/wsen:MaxElements elements that can be used toindicate whether or not multiple elements can be dequeued in one dequeuerequest.

If the enumeration context passed in the dequeue message is not valid,the receiving queue service can fail the request and generate thefollowing fault, as specified in WS-Enumeration:

-   -   [Code] s12:Sender    -   [Subcode] wsen:InvalidEnumerationContext    -   [Reason] “invalid enumeration context”

Step 420 includes a corresponding act of receiving a dequeue message(act 412). For example, queue manager 118 can receive dequeue message176 from queue listener 113. When appropriate, queue manager 118 candecrypt and/or verify the integrity of dequeue message 176. Step 420includes a corresponding act of configuring a message response (act413). For example, queue manager 118 can configure dequeue response 177.Dequeue response 177 can be configured in accordance with the samemessaging protocol as application message 131. Accordingly, dequeueresponse can also include a SOAP envelope. Queue manager 118 can processtransfer message 151B in accordance with WS-Addressing andWS-Coordination when configuring dequeue response 177. Queue manager 118can copy the session ID header, if present, from the nq:TransferHeaderelement of transfer message 151B into dequeue response 177. If thesession ID header has a LastMessage flag, queue manager 118 can add awsen:EndOfSequence element to the body of dequeue response 177.

Since composable protocol elements (e.g., addressing, security,reliability, and transaction protocol elements) of application message131 are encoded, the composable protocol elements of application message131 do not interfere with the configuration of dequeue response 177.Accordingly, any composable protocol elements included in applicationmessage 131 can be reused in dequeue response 177.

Generally, a dequeue response (e.g., a SOAP envelope) can be of theformat of a WS-Enumeration pull response message having additionalconstraints. Generally, elements in a dequeue response have the samemeaning as previously described with respect to an enqueue message, anenqueue response, a transfer message, a store and forward message, astore and forward response, a registration message, a registrationresponse, a session available message, a session accept message, amessage available message, and a dequeue message. Further, a dequeueresponse can include a /s:Envelope/s:Header/nq:Sequence element that cancontain an indication if an enumeration context contained in a dequeuemessage was associated with an application session. A dequeue responsecan include a/s:Envelope/s:Body/wsen:PullResponse/wsen:Items/nq:ApplicationMessage/nq:WrappedXmlBase64element that contains an application SOAP envelope of the applicationmessage, appropriately wrapped. A dequeue response can include a/s:Envelope/s:Body/wsen:PullResponse/wsen:EndOfSequence element that canbe used to indicate the last message in a sequence or that there willnot be additional messages in this context for other reasons.

Step 420 includes a corresponding act of encapsulating the encodedapplication message in the dequeue response (act 414). For example,queue manager 118 can encapsulate encoded application message 131E indequeue response 177. Subsequent to encapsulating encoded applicationmessage 131E, dequeue response 177 can be encrypted and/or digitallysigned. Digitally signing dequeue response 177 provides queue listener113 some assurance of the authenticity of dequeue response 177. Dequeueresponse 177 can be secured using any of a variety of different securitymechanisms including WS-Security or transport layer security, such as,for example, Secure Sockets Layer (“SSL”).

Step 420 includes a corresponding act of sending the dequeue responsefor delivery to the application (act 415). For example, queue manager118 can send dequeue response 177 to queue listener 113. Step 421includes a corresponding act of receiving a dequeue responseencapsulating an encoded application message (act 416). For example,queue listener 113 can receive dequeue response 177 encapsulatingencoded application message 131E. When appropriate, queue listener 113can decrypt and/or verify the integrity of dequeue response 177.

Step 421 includes a corresponding act of decoding the encodedapplication message (act 417). For example, queue listener 113 candecode encoded application message 131E into application message 131.Queue listener 113 can execute an unwrapping algorithm that takes anencoding type (e.g., base64), a content type (e.g., string), and anencoded application message as input and returns an (unencoded)application message as output.

Step 421 includes a corresponding act of sending the application messageto the application (act 418). For example, queue listener 113 can sendapplication message 131 to application 112. If application 112 is notactive, queue listener 113 can send wakeup notification 178 to acontainer environment that manages application 112.

Queue listener 103 can optionally encrypt and/or digitally signapplication message 131 as well. Encrypting and/or digitally signingapplication message 131 helps ensure that the application message 131 isnot modified or intercepted during transmission. Application message131E can be secured using any of a variety of different securitymechanisms, such as, for example, WS-Security.

Application 112 receives and processes application message 112. Whenappropriate, application 112 can decrypt application message 131 toreveal the clear text if application message 131. Application 112 canalso decode a corresponding digital signature to verify the integrity ofapplication message 131.

Applications that read messages from a queue can be hosted in acontainer. An application may not be running for a variety of reasons,such as, for example, the application has failed, the application hasidled out, the application has recycled, etc. A wakeup notificationprovides for notifying a hosting environment of the availability ofmessages in the queue. The hosting environment can use a wakeupnotification to start the application, start another instance of theapplication, or schedule the application for running. Generally, awakeup notification can be of the format (before being secured):<s:Envelope ...>  <s:Header>   <wsa:Action>   http://schemas.testcoep.com/queuing/Wakeup   </wsa:Action>  <wsa:To>xs:anyURI</wsa:To>   <nq:QueueName>xs:anyURI</nq:QueueName>  <nq:Volatile /> ?   ...  </s:Header>  <s:Body /> </s:Envelope>

Generally, elements in a wakeup notification have the same meaning aspreviously described with respect to an enqueue message, an enqueueresponse, a transfer message, a store and forward message, a store andforward response, a registration message, a registration response, asession available message, a session accept message, a message availablemessage, a dequeue message, and a dequeue response. Additionally, awakeup notification message can include a/s:Envelope/s:Header/nq:QueueName element that can contain a name (URI)of the logical queue containing messages to be processed. A wakeupnotification message can include a /s:Envelope/s:Header/nq:Volatileelement that can be used to indicate that the queue messages waiting tobe processed are volatile.

When appropriate, a sending side queue manager (e.g., queue manager 108)can send a cancel transfer message to a receiving side queue manager(e.g., queue manager 118) to close holes in an acknowledgment sequence.A sending side queue manager generates a cancel transfer operation whenit determines that one or more MessageNumbers in a WS-ReliableMessagingsequence will never be received at the receiving side queue manager.When the receiving queue manager receives a cancel transfer message, thereceiving side queue manager continues processing as if the identifiedmessages have been received. The receiving side queue manager canacknowledge the one or more MessageNumbers on the WS-ReliableMessagingsequence as they had actually been received. Generally, a canceltransfer message can be of the format (before being secured):<s:Envelope>  <s:Header>   <wsa:Action>   http://schemas.microsoft.com/queuing/CancelTransfer   </wsa:Action>  <wsa:To>xs:anyURI</wsa:To>   <nq:QueueName>xs:anyURI</nq:QueueName>  <wsa:ReplyTo>wsa:EndpointReferenceType</wsa:ReplyTo>  <wsa:MessageID>xs:anyURI</wsa:MessageID>  </s:Header>  <s:Body>  <nq:CancelTransfer>   <wsu:Identifier>xs:anyURI</wsu:Identifier>  <wsrm:AcknowledgementRange     Upper=“unsignedLong”    Lower=“unsignedLong”/> +   </nq:CancelTransfer>  </s:Body></s:Envelope>

Generally, elements in a cancel transfer message have the same meaningas previously described with respect to an enqueue message, an enqueueresponse, a transfer message, a store and forward message, a store andforward response, a registration message, a registration response, asession available message, a session accept message, a message availablemessage, a dequeue message, a dequeue response, and a wake upnotification. Further, a cancel transfer message can be configured torespect the constraints specified for a transfer message.

A cancel transfer message can include a/s:Envelope/s:Body/*/wsu:Identifier element that can contain a URIconformant with [RFC2396] that uniquely identifies the WS-RM Sequencebeing referenced by this message. A cancel transfer message can includea /s:Envelope/s:Body/*/wsrm:AcknowledgementRange element that can beused to indicate a range of WS-RM message Sequence MessageNumbers thatthe receiving queue service should treat as if they were receivedbecause they will never be sent. A cancel transfer message can include 1or more Envelope/s:Body/*/wsrm:AcknowledgementRange elements. A canceltransfer message can include a/s:Envelope/s:Body/*/wsrm:AcknowledgementRange/@Upper element that canbe used to indicate the message number of the highest contiguous messagein a Sequence range. A cancel transfer message can include/s:Envelope/s:Body/*/wsrm:AcknowledgementRange/(Lower that can be usedto indicate the message number of the lowest contiguous message in aSequence range.

After the transfer of application messages for a session is compete, aqueue channel may close. However, a queue channel can send a detachmessage (e.g., including a session identifier and a queue name) to asending side queue manager to indicate that the session is to remainopen. The sending side queue manager can hold the session open and senda detach response acknowledging that the session is to remain open.

To mark the end of a session, a queue channel can add a LastMessageelement to the nq:Sequence header of the last message for the session.In response to detecting a LastMessage element, a sending side queuemanager can discard any maintained state for the application sessionafter the last message is sent. In response to detecting a LastMessageelement, a receiving side queue manager can use the Message Numberelement to detect that is has received all of the messages for asession. When a session is completed, the receiving side queue managercan deliver the last message for the session in a dequeue response andcan include a wsen:EndOfSequence element in the dequeue response body.After delivering the last message, the receiving side queue manager candiscard any maintained state for the application session. When a queuelistener receives a wsen:EndOfSequence element the enumeration contextbecomes invalid and can be discarded.

FIG. 5 illustrates an example state diagram 500 of different reliablemessaging states at a sending computer system. It should be understoodthat the states depicted in state diagram 500 are per-message. A queuemanager can have a plurality of messages that it is transferring and canassociate a unique state machine with each of the plurality of messages.

For example, a message controlled by a sending side queue manager, suchas, for example, queue manager 108, can transition to captured state 511after capture 501 (i.e., after capturing a message). After initiating atransfer, the sending side queue manager waits for store and forwardacknowledgement. Until a store and forward acknowledgment is received,the sending side queue manager keeps retrying the send.

When store and forward acknowledgement 502 is received, the controlledmessage transitions to sent state 512. The sending side queue managerthen waits for a transfer acknowledgement. When transfer acknowledgement506 is received, the controlled message transitions to transferred state514. The sending side queue manager then waits for a deliveryacknowledgement from the destination queue manager. When deliveryacknowledgment 507 (a positive acknowledgment) is received, the controlmessage transitions to delivered state 515 and can be deleted from acorresponding queue.

After a controlled message transitions to captured state 511, a sendingside queue manager can be configured to wait a specified period of timeto receive a store and forward acknowledgment. When the specified periodof time for receiving a store and forward acknowledgment expires 503,the controlled message transitions to faulted state 513. After acontrolled message transitions to sent state 512, a sending side queuemanager can be configured to wait a specified period of time to receivea transfer acknowledgment. When the specified period of time forreceiving a transfer acknowledgment expires 504, the controlled messagetransitions to faulted state 513. Further, it may be that the sendingside queue manager receives transfer negative acknowledgment 524 thatcauses the controlled message to transition to faulted state 513.

After controlled message transitionins to transferred state 514, asending side queue manager can be configured to wait a specified periodof time to receive a delivery acknowledgment. When the specified periodof time for receiving a delivery acknowledgment expires 505, thecontrolled message transitions to faulted state 513. Further, it may bethat the sending side queue manager receives a delivery negativeacknowledgment 525 that causes the controlled message to transition tofaulted state 513. Transfer and delivery acknowledgments and negativeacknowledgment can be sent to an error service running in the sendingside queue manager. If a user has requested no transfer assurances,controlled messages can be deleted after a store and forwardacknowledgement is received.

FIG. 6 illustrates an example state diagram of different reliablemessaging states at a receiving computer system. It should be understoodthat the states depicted in state diagram 600 are per-message. Forexample, a message controlled by a receiving side queue manager, suchas, for example, queue manager 118, can transition to received state 611after normal receive 601 (i.e., normal reception of a message). Asuccessfully received message can be captured in a message queue. Thereceiving side queue manager can also send a store and forwardacknowledgment 624 back to the previous store and forward service orstore and forward layer. After sending a store and forwardacknowledgment 624, the receiving side queue manager can send transferacknowledgment 604. The receiving side queue manager then queues themessage.

After sending both store and forward acknowledgment 624 and transferacknowledgment 604, a controlled message transitions to acknowledgementsent state 614. When the message is dequeued 605, the receiving sidequeue manager can transfer to a delivered state. After the message isconsumed by the receiving application, the controlled messagetransitions to delivered state 615.

On the other hand, a controlled message can transition to faulted state612 after receive with errors 602 (i.e., a message is received witherrors, such as, for example, no such queue here or sender notauthorized to send to this queue). The receiving side queue manager-canalso send a store and forward acknowledgment 623 back to the previousstore and forward service or store and forward layer. After sending astore and forward acknowledgment 603, the receiving side queue managercan send transfer negative acknowledgment 603 (to potentially promptretransmission). After sending both, store and forward acknowledgment624 and transfer negative acknowledgment 603, a controlled message, cantransition to negative acknowledgement sent state 613. The transfer anddelivery ACKs and NACKs are sent to an error service hosted at thesending side queue manager.

FIG. 7 illustrates a suitable operating environment for the principlesof the present invention. FIG. 7 and the following discussion areintended to provide a brief, general description of a suitable computingenvironment in which the invention may be implemented. Although notrequired, the invention will be described in the general context ofcomputer-executable instructions, such as program modules, beingexecuted by computer systems. Generally, program modules includeroutines, programs, objects, components, data structures, and the like,which perform particular tasks or implement particular abstract datatypes. Computer-executable instructions, associated data structures, andprogram modules represent examples of the program code means forexecuting acts of the methods disclosed herein.

With reference to FIG. 7, an example system for implementing theinvention includes a general-purpose computing device in the form ofcomputer system 720, including a processing unit 721, a system memory722, and a system bus 723 that couples various system componentsincluding the system memory 722 to the processing unit 721. Processingunit 721 can execute computer-executable instructions designed toimplement features of computer system 720, including features of thepresent invention. The system bus 723 may be any of several types of busstructures including a memory bus or memory controller, a peripheralbus, and a local bus using any of a variety of bus architectures. Thesystem memory includes read only memory (“ROM”) 724 and random accessmemory (“RAM”) 725. A basic input/output system (“BIOS”) 726, containingthe basic routines that help transfer information between elementswithin computer system 720, such as during start-up, may be stored inROM 724.

The computer system 720 may also include magnetic hard disk drive 727for reading from and writing to magnetic hard disk 739, magnetic diskdrive 728 for reading from or writing to removable magnetic disk 729,and optical disk drive 730 for reading from or writing to removableoptical disk 731, such as, or example, a CD-ROM or other optical media.The magnetic hard disk drive 727, magnetic disk drive 728, and opticaldisk drive 730 are connected to the system bus 723 by hard disk driveinterface 732, magnetic disk drive-interface 733, and optical driveinterface 734, respectively. The drives and their associatedcomputer-readable media provide nonvolatile storage ofcomputer-executable instructions, data structures, program modules, andother data for the computer system 720. Although the example environmentdescribed herein employs magnetic hard disk 739, removable magnetic disk729 and removable optical disk 731, other types of computer readablemedia for storing data can be used, including magnetic cassettes, flashmemory cards, digital versatile disks, Bernoulli cartridges, RAMs, ROMs,and the like.

Program code means comprising one or more program modules may be storedon hard disk 739, magnetic disk 729, optical disk 731, ROM 724 or RAM725, including an operating system 735, one or more application programs736, other program modules 737, and program data 738. A user may entercommands and information into computer system 720 through keyboard 740,pointing device 742, or other input devices (not shown), such as, forexample, a microphone, joy stick, game pad, scanner, or the like. Theseand other input devices can be connected to the processing unit 721through input/output interface 746 coupled to system bus 723.Input/output interface 746 logically represents any of a wide variety ofdifferent interfaces, such as, for example, a serial port interface, aPS/2 interface, a parallel port interface, a Universal Serial Bus(“USB”) interface, or an Institute of Electrical and ElectronicsEngineers (“IEEE”) 1394 interface (i.e., a FireWire interface), or mayeven logically represent a combination of different interfaces.

A-monitor 747 or other display device is also connected to system bus723 via video interface 748. Other peripheral output devices (notshown), such as, for example, speakers and printers, can also beconnected to computer system 720.

Computer system 720 is connectable to networks, such as, for example, anoffice-wide or enterprise-wide computer network, a home network, anintranet, and/or the Internet. Computer system 720 can exchange datawith external sources, such as, for example, remote computer systems,remote applications, and/or remote databases over such networks.

Computer system 720 includes network interface 753, through whichcomputer system 720 receives data from external sources and/or transmitsdata to external sources. As depicted in FIG. 7, network interface 753facilitates the exchange of data with remote computer system 783 vialink 751. Network interface 753 can logically represent one or moresoftware and/or hardware modules, such as, for example, a networkinterface card and corresponding Network Driver Interface Specification(“NDIS”) stack. Link 751 represents a portion of a network (e.g., anEthernet segment), and remote computer system 783 represents a node ofthe network.

Likewise, computer system. 720 includes input/output interface 746,through which computer system 720 receives data from external sourcesand/or transmits data to external sources. Input/output interface 746 iscoupled to modem 754 (e.g., a standard modem, a cable modem, or digitalsubscriber line (“DSL”) modem) via link 759, through which computersystem 720 receives data from and/or transmits data to external sources.As depicted in FIG. 7, input/output interface 746 and modem 754facilitate the exchange of data with remote computer system 793 via link752. Link 752 represents a portion of a network and remote computersystem 793 represents a node of the network.

While FIG. 7 represents a suitable operating environment for the presentinvention, the principles of the present invention may be employed inany system that is capable of, with suitable modification if necessary,implementing the principles of the present invention. The environmentillustrated in FIG. 7 is illustrative only and by no means representseven a small portion of the wide variety of environments in which theprinciples of the present invention may be implemented.

In accordance with the present invention, modules includingapplications, queue channels, queue listeners, queue managers, transferlayers, store and forward layers, and store and forward services as wellas associated data, including application messages, encoded applicationmessages, enqueue messages, enqueue responses, transfer messages,encoded transfer headers, store and forward messages, store and forwardresponses, session available messages, accept messages, messageavailable messages, dequeue messages, dequeue responses, wake upnotifications, and active session IDs, can be stored and accessed fromany of the computer-readable media associated with computer system 720.For example, portions of such modules and portions of associated programdata may be included in operating system 735, application programs 736,program modules 737 and/or program data 738, for storage in systemmemory 722.

When a mass storage device, such as, for example, magnetic hard disk739, is coupled to computer system 720, such modules and associatedprogram data may also be stored in the mass storage device. In anetworked environment, program modules depicted relative to computersystem 720, or portions thereof, can be stored in remote memory storagedevices, such as, system memory and/or mass storage devices associatedwith remote computer system 783 and/or remote computer system 793.Execution of such modules may be performed in a distributed environmentas previously described.

The present invention may be embodied in other specific forms withoutdeparting from its spirit or essential characteristics. The describedembodiments are to be considered in all respects only as illustrativeand not restrictive. The scope of the invention is, therefore, indicatedby the appended claims rather than by the foregoing description. Allchanges which come within the meaning and range of equivalency of theclaims are to be embraced within their scope.

1. At a computer system that is network connectable along with one ormore other computer systems to a network, a method of reliably enqueinga message, the method comprising: an act of receiving an applicationmessage configured in accordance with a messaging protocol; an act ofencoding the application message into a corresponding encodedapplication message; an act of configuring an enqueue message inaccordance with the messaging protocol, the enqueue message identifyinga message queue that is to queue the application message; an act ofencapsulating the encoded application message in the enqueue message;and an act of sending the enqueue message to a queue manager thatcontrols the identified queue such that the application message can bequeued for delivery to a receiving computer system.
 2. The method asrecited in claim 1, wherein the act of receiving an application messageconfigured in accordance with a messaging protocol comprises an act of aqueue channel receiving a subroutine call including the applicationmessage.
 3. The method as recited in claim 1, wherein the act ofreceiving an application message configured in accordance with amessaging protocol comprises an act of receiving a SOAP envelope.
 4. Themethod as recited in claim 1, wherein the act of encoding theapplication message into a corresponding encoded applicationmessage_comprises an act of binary encoding the application message. 5.The method as recited in claim 4, wherein the act of binary encoding theapplication message comprises an act of base64 encoding the applicationmessage.
 6. The method as recited in claim 1, wherein the act ofencoding the application message into a corresponding encodedapplication message comprises an act of text encoding the applicationmessage.
 7. The method as recited in claim 1, wherein the act ofencoding the application message into a corresponding encodedapplication message comprises: an act of providing the receivedapplication message, an encoding type, and a content type as input to awrapping algorithm; and an act of receiving an encoded applicationmessage as output from the wrapping algorithm.
 8. The method as recitedin claim 1, further comprising: an act of encoding a session identifieralong with the application message.
 9. The method as recited in claim 1,wherein the act of configuring an enqueue message in accordance with themessaging protocol comprises an act of configuring a SOAP envelope. 10.The method as recited in claim 1, wherein the act of configuring anenqueue message in accordance with the messaging protocol comprises anact of configuring the enqueue message to identify a message sessioncorresponding to the application message.
 11. The method as recited inclaim 1, wherein the act of configuring an enqueue message in accordancewith the messaging protocol comprises an act of reusing at least onecomposable protocol element from a SOAP application message.
 12. Themethod as recited in claim 1, wherein the act of encapsulating theencoded application message in the enqueue message comprises an act ofencapsulating an encoded SOAP application message in a SOAP enqueuemessage.
 13. The method as recited in claim 12, wherein the act ofencapsulating an encoded SOAP application message in a SOAP enqueuemessage comprises an act of including decoding information for decodingthe encoded SOAP application message within the SOAP enqueue message.14. The method as recited in claim 1, wherein the act of sending theenqueue message to a queue manager that controls the identified queuecomprises an act of using an atomic transaction context to coordinateenqueueing the application message with other application state changes.15. The method as recited in claim 1, wherein the act of sending theenqueue message to a queue manager that controls the identified queuecomprises an act of participating in a two-phase commit.
 16. The methodas recited in claim 1, wherein the act of sending the enqueue message toa queue manager that controls the identified queue comprises an act ofusing a reliable messaging protocol to send the enqueue message.
 17. Themethod as recited in claim 1, further comprising an act of performing atleast one of encrypting and digitally signing the encoded applicationmessage prior to encapsulating the application message.
 18. The methodas recited in claim 1, further comprising an act of performing at leastone of encrypting and digitally signing the enqueue message prior tosending the enqueue message.
 19. The method as recited in claim 1,further comprising: an act of receiving an enqueue response from thequeue manager.
 20. The method as recited in claim 19, wherein the act ofreceiving an enqueue response comprises an act of using a reliablemessaging protocol to receive the enqueue response.
 21. The method asrecited in claim 19, wherein the act of receiving an enqueue responsecomprises an act of using an atomic transaction context to coordinateenqueueing the application message with other application state changes.22. The method as recited in claim 19, wherein the act of receiving anenqueue response comprises an act of participating in a two-phasecommit.
 23. The method as recited in claim 19, wherein the act ofreceiving an enqueue response comprises an cat of receiving an enqueueresponse that is at least one of encrypted and digitally signed.
 24. Ata computer system that is network connectable along with one or moreother computer systems to a network, a method of reliably transferring amessage, the method comprising: an act of receiving a message availablemessage indicating that an application message, configured in accordancewith a messaging protocol, is available for delivery to an application;an act of sending a dequeue message in response to the message availablemessage, the dequeue message indicating that the application message isto be dequeued for delivery to the application; an act of receiving adequeue response, the dequeue response configured in accordance with themessaging protocol, the dequeue response encapsulating an encodedapplication message; an act of decoding the encoded application messageinto the application message; an act of sending the application messageto the application.
 25. The method as recited in claim 24, wherein theact of receiving a message available message indicating that anapplication message is available for delivery comprises an act of aqueue listener receiving a message available message.
 26. The method asrecited in claim 24, wherein the act of receiving a message availablemessage indicating that an application message is available for deliverycomprises an act of receiving a SOAP message available messageindicating that a SOAP application message is available for delivery.27. The method as recited in claim 24, wherein the act of sending adequeue message in response to the message available message comprisesan act of sending a dequeue message that identifies a message queue andthe application message.
 28. The method as recited in claim 24, whereinthe act of sending a dequeue message in response to the messageavailable message comprises an act of using an atomic transactioncontext to coordinate dequeueing the application message with otherapplication state changes.
 29. The method as recited in claim 24,wherein the act of sending a dequeue message in response to the messageavailable message comprises an act of participating in a two-phasecommit.
 30. The method as recited in claim 24, wherein the act ofsending a dequeue message in response to the message available messagecomprises an act of using a reliable messaging protocol to send thedequeue message.
 31. The method as recited in claim 24, wherein the actof receiving a dequeue response comprises an act of receiving a SOAPdequeue response that encapsulates an encoded SOAP application message.32. The method as recited in claim 24, wherein the act of receiving adequeue response comprises an act of receiving a dequeue response thatincludes information for decoding an encoded application messageencapsulated within the dequeue response.
 33. The method as recited inclaim 24, wherein the act of receiving a dequeue response comprises anact of receiving a SOAP dequeue response that reuses at least onecomposable protocol element from an encoded SOAP application messageencapsulated within the dequeue response.
 34. The method as recited inclaim 24, wherein the act of receiving a dequeue response comprises anact of using an atomic transaction context to coordinate dequeueing theapplication message with other application state changes.
 35. The methodas recited in claim 24, wherein the act of receiving a dequeue responsecomprises an act of participating in a two-phase commit.
 36. The methodas recited in claim 24, wherein the act of receiving a dequeue responsecomprises an act of using a reliable messaging protocol to receive thedequeue response.
 37. The method as recited in claim 24, wherein the actof decoding the encoded application message into the application messagecomprises an act of decoding a text encoded application message.
 38. Themethod as recited in claim 24, wherein the act of decoding the encodedapplication message into the application message comprises an act ofdecoding a binary encoded application message.
 39. The method as recitedin claim 38, wherein the act of decoding a binary encoded applicationmessage comprises an act of decoding a base64 encoded applicationmessage.
 40. The method as recited in claim 24, wherein the act ofdecoding the encoded application message into the application messagecomprises: an act of providing the encoded application message, anencoding type, and a content type as input to an unwrapping algorithm;and an act of receiving the application message as output from theunwrapping algorithm.
 41. The method as recited in claim 24, furthercomprising an act of performing at least one of decrypting and verifyingthe integrity of the dequeue response.
 42. The method as recited inclaim 24, further comprising an act of performing at least one ofdecrypting and verifying the integrity of the encoded applicationmessage prior to decoding the encoded application message.
 43. Themethod as recited in claim 24, wherein the act of sending theapplication message to the application comprises an act of sending aSOAP message to the application.
 44. The method as recited in claim 24,further comprising: an act of sending a wake-up notification to theapplication prior to delivering the application message to theapplication.
 45. The method as recited in claim 24, further comprising:an act of receiving a session available message prior to receiving themessage available message, the session available message indicating thatmessage is part of an application session; an act of sending a sessionaccept message in response to the session available message; and an actof receiving a session accept response subsequent to sending the sessionaccept message.
 46. The method as recited in claim 24, furthercomprising: an act of sending a registration message indicating aninterest in messages corresponding to the application, prior toreceiving the message available message; and an act of receiving aregistration response indicating that the registration was successful.47. A computer program product for use at a computer system that isnetwork connectable along with one or more other computer systems to anetwork, the computer program product for implementing a method ofreliably enqueing a message, the computer program product comprising oneor more computer-readable media having stored thereoncomputer-executable instructions, that when executed by a processor,cause the computer system to perform the following: receive anapplication message configured in accordance with a messaging protocol;encode the application message into a corresponding encoded applicationmessage; configure an enqueue message in accordance with the messagingprotocol, the enqueue message identifying a message queue that is toqueue the application message; encapsulate the encoded applicationmessage in the enqueue message; and send the enqueue message to a queuemanager that controls the identified queue such that the applicationmessage can be queued for delivery to a receiving computer system.
 48. Acomputer program product for use at a computer system that is networkconnectable along with one or more other computer systems to a network,the computer program product for implementing a method of reliablytransferring a message, the computer program product comprising one ormore computer-readable media having stored thereon computer-executablesinstructions, that when executed by a processor, cause the computersystem to perform the following: receive a message available messageindicating that an application message, configured in accordance with amessaging protocol, is available for delivery to an application; send adequeue message in response to the message available message, thedequeue message indicating that the application message is to bedequeued for delivery to the application; receive a dequeue response,the dequeue response configured in accordance with the messagingprotocol, the dequeue response encapsulating an encoded applicationmessage; decode the encoded application message into the applicationmessage; send the application message to the application.